<?php
				
//Set Pass Process
if (isset($_POST['setpass'])) {
$controlmsg = new xmlrpcmsg('atheme.command');
				$controlmsg->addParam(new xmlrpcval($authcookie, $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval($uname, $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval(".", $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval("NickServ", $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval("SET", $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval("PASSWORD", $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval($_POST['setpass'], $xmlrpcString));
			$client = new xmlrpc_client(PATH, HOST, PORT);
			$controlresponse = $client->send($controlmsg);
			if($controlresponse->faultCode()) {
				printf('<h3>Fault</h3>');
				printf('Fault code: %d<br>', htmlentities($controlresponse->faultCode()));
				printf('Fault string: %s', htmlentities($controlresponse->faultString()));

				}else{ 
				echo $controlresponse->serialize(); }

				}	

//Change Email Process
if (isset($_POST['setmail'])) {
$controlmsg = new xmlrpcmsg('atheme.command');
				$controlmsg->addParam(new xmlrpcval($authcookie, $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval($uname, $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval(".", $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval("NickServ", $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval("SET", $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval("EMAIL", $xmlrpcString));
				$controlmsg->addParam(new xmlrpcval($_POST['setmail'], $xmlrpcString));
			$client = new xmlrpc_client(PATH, HOST, PORT);
			$controlresponse = $client->send($controlmsg);
			if($controlresponse->faultCode()) {
				printf('<h3>Fault</h3>');
				printf('Fault code: %d<br>', htmlentities($controlresponse->faultCode()));
				printf('Fault string: %s', htmlentities($controlresponse->faultString()));

				}else{ 
				echo $controlresponse->serialize(); }

				}					
		
											
				
				
?>
<?php if (isset($_POST['infochan']) || isset($_POST['flistchan']) || isset($_POST['rtfm'])){ echo "</pre>"; } ?>
<h1>NickServ</h1>
<hr />
<a href="#" onclick="showhide('div1');"><h3>Change Password</h3></a>
<div id="div1" style="display: none;">
<form method="post" action="<?php echo $PHP_SELF;?>"> 
New Password<br />
<input type="text" size="12" maxlength="20" name="setpass"><br />
<input type="submit" value="Change Pass!" name="submit">
</form>
</div>

<a href="#" onclick="showhide('div2');"><h3>Change Email</h3></a>
<div id="div2" style="display: none;">
<form method="post" action="<?php echo $PHP_SELF;?>"> 
New Email<br />
<input type="text" size="12" maxlength="30" name="setmail"><br />
<input type="submit" value="Change Email!" name="submit">
</form>
</div>

